<template>
  <a-card title="选择部门">
    <a-tree-select
      :field-names="{
        value: 'id',
        label: 'label',
      }"
      class="w-[100%]"
      :tree-data="deptTreeData"
      v-model:value="model"
    ></a-tree-select>
  </a-card>
</template>

<script setup lang="ts">
import { deptTreeData, getDeptTree } from './data';

const model = defineModel('modelValue');

onMounted(async () => {
  deptTreeData.value = await getDeptTree();
});
</script>

<style lang="scss" scoped></style>
